package org.tulkas.web;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.DispatcherServlet;
import org.springframework.web.util.UrlPathHelper;

/**
 * @author <a href="mailto:tulkas.web@gmail.com">Tulkas</a>
 *
 */
@SuppressWarnings("serial")
public class TulkasServlet extends DispatcherServlet {
	private UrlPathHelper urlPathHelper = new UrlPathHelper();

	/* (non-Javadoc)
	 * @see org.springframework.web.servlet.DispatcherServlet#noHandlerFound(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
	 */
	protected void noHandlerFound(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		String requestUri = urlPathHelper.getRequestUri(request);
		response.sendError(HttpServletResponse.SC_NOT_FOUND, requestUri);
	}
}
